public class Test {
    String name;
    int age;
    int weight;

    //构造方法
    public Test() {
        this.name = "zhangsan";
        this.age = 18;
        this.weight = 70;
    }

    //静态成员变量
    public static void happy(){
        System.out.println("hahaha");
    }

    //静态成员变量
    static int num;
    static{
        num=4;
    }

    public static void main(String[] args) {
        Test test = new Test();
        System.out.println("姓名："+test.name);
        System.out.println("年龄："+test.age);
        System.out.println("体重："+test.weight);
        Test.happy();
        System.out.println(Test.num);
    }
}

